<?php

namespace App\Models;

class CommodityActivityStatistics extends Base
{
    /**
     * 累计培养奖
     * @param int $amount
     * @param string $method
     * @param int $numberOfCultivationAwards
     */
    public function incrementOrDecrementCultivationAwards($method = 'increment', $amount = Agent::CULTIVATION_AWARD, $numberOfCultivationAwards = 1)
    {
        $this->{$method}('number_of_cultivation_awards', $numberOfCultivationAwards);
        $this->{$method}('total_amount_of_cultivation_awards', $amount);
    }

    /**
     * 累计补偿款
     * @param string $amount
     * @param string $method
     * @return int|void
     */
    public function incrementOrDecrementCompensation($amount, $method = 'increment')
    {
        $this->{$method}('total_amount_of_after_sale_compensation', $amount);
    }

    /**
     * 累计补偿款
     * @param string $amount
     * @param string $method
     * @return int|void
     */
    public function incrementOrDecrementShippingReturnCompensation($amount, $method = 'increment')
    {
        $this->{$method}('total_amount_of_after_sale_compensation_for_shipping_return', $amount);
    }
}
